<?php
session_start();
      
    include ('../includes/config.php');
    
    include ('../includes/authenticate.php');
    
    include ('../includes/database.php');
    include ('../includes/user_header.php');
    
    $sql = "SELECT * FROM events";
    $result = mysql_query($sql) or die("Error: " . mysql_error())
?>

<div class="container">
     <div class="navbar">
         <div class="navbar-inner">
             <a class="brand" href="#"> Title</a>
             <ul class="nav">
                 <li><a href="#">Link</a></li>
                 <li><a href="#">Link</a></li>
             </ul>
             <ul class="nav pull-right">
                 <li><a href="<?php echo $_config['base_url'] ?>logout.php">Logout</a></li>
             </ul>
         </div>
     </div>
    <div class="span12">                 
        <h1>Events</h1>
        <table class="table table-hover">
            <thead>
                <tr>
                    <th>#</th>
                    <th> Nama Event </th>
                    <th>Tempat</th>
                     <th>waktu</th>
                    <th>Aksi</th>
                 </tr>
            </thead>
            <tbody>
                
                <?php $i =1; ?>
                <?php while ($event = mysql_fetch_assoc($result)): ?>
                <tr>
                    <td><?php echo $i; ?></td>
                    <td><?php echo $event["name"]; ?></td>
                    <td><?php echo $event["place"]; ?></td>
                    <td><?php echo $event["date"]; ?></td>
                 <td>
                     <a href="<?php echo $__config["base_url"] ?>administrator/event_edit.php?id=<?php echo $event["id"]?>" class="btn">Edit</a>
                     <a href="#" class="btn btn-danger">Delete</a>
                 </td>
             </tr>
            <?php  $i++; ?>
            <?php endwhile;?>

             
             
            </tbody>
        </table>
    </div>
  </div>
</tr>
        
    
    
    <?php
     include ('../includes/user_footer.php');
?>
  
    
?>
